<?php 

// Europa100AD
//
// Test - Aug 2007
//

 /* 
$dir    = '/includes/';
$files1 = scandir($dir);
$files2 = scandir($dir, 1);
echo '<pre>';
print_r($files1);
print_r($files2);  
echo '</pre>';
 */
 
require_once('/var/www/vhosts/europa100ad.com/includes/database.inc.php');
require_once('/var/www/vhosts/europa100ad.com/includes/recaptcha.inc.php');



# the response from reCAPTCHA
$resp = null;
# the error code from reCAPTCHA, if any
$error = null;

# are we submitting the page?
if ($_POST["submit"]) {
  $resp = recaptcha_check_answer ($privatekey,
                                  $_SERVER["REMOTE_ADDR"],
                                  $_POST["recaptcha_challenge_field"],
                                  $_POST["recaptcha_response_field"]);

  if ($resp->is_valid) {
    echo "You got it!";
    # in a real application, you should send an email, create an account, etc
  } else {
    # set the error code so that we can display it. You could also use
    # die ("reCAPTCHA failed"), but using the error message is
    # more user friendly
    $error = $resp->error;
  }
}


?>

<form action="" method="post"><br/><input type="submit" name="submit" value="submit" />
    <?php
    echo recaptcha_get_html($publickey, $error);
    ?>
    </form>